package com.shen.thread.state;

public class TestJoin implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 50; i++) {
            System.out.println("vip come" + i);
        }
    }

    public static void main(String[] args) throws InterruptedException {
        TestJoin join = new TestJoin();
        Thread thread = new Thread(join);
        thread.start();

        //主线程
        for (int i = 0; i < 200; i++) {
            if (i == 50) {
                thread.join();
            }
            System.out.println("main " + i);
        }
    }
}
